<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>资源信息</title>
		<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}

a {
	font-size: 12px;
	color: #000;
	text-decoration: none;
}

a:hover {
	color: #CA5466;
	text-decoration: underline;
}

.STYLE1 {
	font-size: 12px
}

.STYLE3 {
	font-size: 12px;
	font-weight: bold;
}

.STYLE4 {
	color: #03515d;
	font-size: 12px;
}

.td_bg {
	font-size: 13px;
	background: #fff;
	border: 1px solid #6495ED;
}

/*表单项的字体格式*/
.td_x_bg {
	font-size: 13px;
	font-weight: bold;
	text-align: center;
	background: #BDE3FB;
	border: 1px solid #6495ED;
	height: 40px;
}

.table {
	margin-top: 10px;
}
</style>
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/checkUtil.js"></script>

	</head>

	<body>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="30" background="images/main/tab_05.gif">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="12" height="30">
								<img src="images/main/tab_03.gif" width="12" height="30" />
							</td>
							<td>
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="46%" valign="middle">
											<table width="100%" border="0" cellspacing="0"
												cellpadding="0">
												<tr>
													<td width="5%">
														<div align="center">
															<img src="images/main/tb.gif" width="16" height="16" />
														</div>
													</td>
													<td width="95%" class="STYLE1">
														<span class="STYLE3">你当前的位置</span>：[资源共享]-[查看资源详细信息]
													</td>
												</tr>
											</table>
										</td>
										<td width="54%">
											<table border="0" align="right" cellpadding="0"
												cellspacing="0">
												<tr>
													<td width="80">
														<table width="90%" border="0" cellpadding="0"
															cellspacing="0">
															<tr>
																<td>
																</td>
															</tr>
														</table>
													</td>
													<td width="60">
														<table width="90%" border="0" cellpadding="0"
															cellspacing="0">
															<tr>
																<td class="STYLE1"></td>
																<td class="STYLE1">
																	<br>
																</td>
															</tr>
														</table>
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
							<td width="16">
								<img src="images/main/tab_07.gif" width="16" height="30" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="8" background="images/main/tab_12.gif">
								&nbsp;
							</td>
							<td>
								<table class="table" border="1" width="70%" align="center"
									cellpadding="2" cellspacing="2" bordercolor="#6495ED">
									<tbody>
										<tr>

											<td class="td_x_bg" style="height: 20px; text-align: left">
												<nobr>
													资源详细信息
												</nobr>
											</td>
										</tr>
										<tr>

											<td class="td_bg">
												<ul>
													<li>
														文件名称：<s:property value="resource.docName" />.<s:property value="resource.docType" />
													</li>
													<li>
														格式：<s:property value="resource.docType" />
													</li>
													<li>
														文件大小：<s:property value="resource.docSize/1024" />KB
													</li>
													<li>
														文件分类：<span class="STYLE1">
																	<s:if test="resource.docGroup == 0">兴趣爱好</s:if>
																	<s:elseif test="resource.docGroup == 1">Java</s:elseif>
																	<s:elseif test="resource.docGroup == 2">PHP</s:elseif>
																	<s:elseif test="resource.docGroup == 3">LINUX</s:elseif>
																	<s:elseif test="resource.docGroup == 4">数据库</s:elseif>
																	<s:else>其它</s:else>
																</span>
													</li>
													<li>
														上传人：<a href="front/getMemberInfo.action?user.id=3"><s:property value="resource.uploader.name" /></a>
													</li>
													<li>
														上传时间：<s:date name="resource.uploadDate"format="yyyy年MM月dd日 hh:mm" nice="false" />
													</li>
													<li>
														下载次数:<s:property value="resource.download" />次
													</li>
													<li>
														资源描述：
														<div
															style="border: 1px solid #6495ED; padding: 5px; height: 50px;">
															<s:property value="resource.description" />
														</div>
													</li>
													<li>
														<b><a href="front/downloadResource.action?resource.id=<s:property value="resource.id" />" >下载</a>
														</b>
													</li>
												</ul>
											</td>
										</tr>
									</tbody>

								</table>
								<table class="table" border="1" width="70%" align="center"
									cellpadding="2" cellspacing="2" bordercolor="#6495ED">
									<tbody>
										<tr>

											<td class="td_x_bg" style="height: 20px; text-align: left">
												<nobr>
													用户下载评论：
												</nobr>
											</td>
										</tr>
										<tr>
											<td class="td_bg">
												<s:if test="resourceMessages.size == 0">
													<table class="table" border="1" width="100%" align="center"
														cellpadding="2" cellspacing="2" bordercolor="#6495ED">
														<tr>
															<td class="td_x_bg"
																style="text-align: left; padding-left: 20px;">
																暂无评论
															</td>
														</tr>
													</table>
												</s:if>
												<s:else>
													<table class="table" border="1" width="100%" align="center"
														cellpadding="2" cellspacing="2" bordercolor="#6495ED">
														<tbody>
															<tr>
																<td class="td_x_bg" width="120px">
																	<nobr>
																		留言者
																	</nobr>
																</td>
																<td class="td_x_bg"
																	style="text-align: left; padding-left: 20px;">
																	<nobr>
																		内容
																	</nobr>
																</td>
																<s:if test="#session.user.post in {3,4}">
																	<td class="td_x_bg" width="50px">
																		<nobr>
																			操作
																		</nobr>
																	</td>
																</s:if>

															</tr>

															<s:iterator value="resourceMessages" var="resourceMessages"
																status="status">
																<tr>
																	<td class="td_bg" width="120px">
																		<nobr>
																			<s:property
																				value="#status.count + (page.currentPage-1)*page.pageSize" />
																			..
																			<a
																				href="front/getMemberInfo.action?user.id=<s:property value="#resourceMessages.user.id" />">
																				<s:property value="#resourceMessages.user.name" /> </a>
																		</nobr>
																	</td>
																	<td class="td_bg">
																		<div>
																			<s:property value="#resourceMessages.content"
																				escape="false" />
																		</div>
																		<span style="float: right;">时间：<s:date
																				name="#resourceMessages.messageTime"
																				format="yyyy年MM月dd日 hh:mm:ss" nice="false" />
																		</span>
																	</td>
																	<s:if test="#session.user.post in {3,4}">
																		<td class="td_bg"
																			style="padding: 0; font-weight: normal; font-size: 11px; text-align: center;">
																			<nobr>
																				<a
																					href="front/deleteRMessage.action?resourceMessage.id=<s:property value="#resourceMessages.id"/>&resourceMessage.resource.id=<s:property value="#resourceMessages.resource.id"/>"
																					onclick="return confirm('确认删除？');">删除</a>
																			</nobr>
																		</td>
																	</s:if>
																</tr>
															</s:iterator>
													</table>
													</s:else>
													<form action="front/getResourceInfo.action" method="get"
														style="margin: 2px;">
														<table width="100%" border="0" cellspacing="0"
															cellpadding="0">
															<tr>
																<td class="STYLE4">
																	&nbsp;&nbsp;共有
																	<s:property value="page.rowCount" />
																	条记录， 当前第
																	<s:property value="page.currentPage" />
																	/
																	<s:property value="page.pageCount" />
																	页
																</td>
																<td>
																	<table border="0" align="right" cellpadding="0"
																		cellspacing="0">
																		<tr>
																			<td width="40">
																				<a
																					href="front/getResourceInfo.action?resource.id=<s:property value="resource.id"/>&page.currentPage=1"><img
																						src="images/main/first.gif" width="37" height="15"
																						border="0" /> </a>
																			</td>
																			<s:if test="page.currentPage != 1">
																				<td width="45">
																					<a
																						href="front/getResourceInfo.action?resource.id=<s:property value="resource.id"/>&page.currentPage=<s:property value="page.currentPage - 1" />"><img
																							src="images/main/back.gif" width="43" border="0"
																							height="15" /> </a>
																				</td>
																			</s:if>
																			<s:if test="page.currentPage != page.pageCount">
																				<td width="45">
																					<a
																						href="front/getResourceInfo.action?resource.id=<s:property value="resource.id"/>&page.currentPage=<s:property value="page.currentPage + 1" />"><img
																							src="images/main/next.gif" width="43" border="0"
																							height="15" /> </a>
																				</td>
																			</s:if>
																			<td width="40">
																				<a
																					href="front/getResourceInfo.action?resource.id=<s:property value="resource.id"/>&page.currentPage=<s:property value="page.pageCount" />""><img
																						src="images/main/last.gif" border="0" width="37"
																						height="15" /> </a>
																			</td>
																			<td width="100">
																				<div align="center">
																					<span class="STYLE1">转到第 <input
																							type="hidden" name="resource.id"
																							value="<s:property value="resource.id"/>" /> <input
																							name="page.currentPage" type="text" size="4"
																							style="height: 12px; width: 20px; border: 1px solid #999999;" />
																						页 </span>
																				</div>
																			</td>
																			<td width="40">
																				<input type="image" src="images/main/go.gif"
																					width="37" height="15" />
																			</td>
																		</tr>
																	</table>
																</td>
															</tr>
														</table>
													</form>
											</td>
										</tr>
										<tr>
											<td class="td_x_bg" style="height: 20px; text-align: left">
												<b>我要评论</b>
											</td>
										</tr>
										<tr>
											<td class="td_bg">
												<form action="front/addResourceMessage.action" method="post" >
													<script src="/ztmStruts2/FCKeditor/fckeditor.js"></script>
													<script>
											            var editor = new FCKeditor('resourceMessage.content');
											            editor.BasePath = '/ztmStruts2/FCKeditor/';
											            editor.Height = 200;
											            editor.Width = 650;
											            editor.ToolbarSet = 'answer';
											            editor.Create();
											         </script>
													<br />
													<input type="hidden" name="resourceMessage.resource.id"
														value="<s:property value="resource.id"/> " />
													<input type="hidden" name="resourceMessage.user.id"
														value="<s:property value="#session.user.id" />" />
													<input type="submit" value="提交"
														style="width: 80px; height: 35px; margin: 10px;" />
												</form>
											</td>
										</tr>

									</tbody>

								</table>
							</td>
							<td width="8" background="images/main/tab_15.gif">
								&nbsp;
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td height="35" background="images/main/tab_19.gif">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="12" height="35">
								<img src="images/main/tab_18.gif" width="12" height="35" />
							</td>
							<td>
								<form action="" method="get">
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td>
												&nbsp;
											</td>
										</tr>
									</table>
								</form>
							</td>
							<td width="16">
								<img src="images/main/tab_20.gif" width="16" height="35" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</body>
</html>
